using DG.Tweening;
using UnityEngine;

namespace BToolkit
{
    public class LuckyCardDemo : MonoBehaviour
    {
        public LuckyCardDriver luckyTable;

        private void Awake()
        {
            LuckyCardDemoCell[] cells = GetComponentsInChildren<LuckyCardDemoCell>();
            for (int i = 0; i < cells.Length; i++)
            {
                cells[i].text.text = i.ToString();
            }

            luckyTable.SetCellUpdateCallback((LuckyCardDemoCell cell, int index) =>
            {
                cell.transform.localScale = Vector3.one * 0.6f;
                cell.transform.DOScale(Vector3.one, 0.6f);
            });
        }

        void Update()
        {
            if (Input.GetMouseButtonUp(0))
            {
                luckyTable.StartRun(5, 10, (LuckyCardDemoCell cell) =>
                {

                });
            }
        }
    }
}